fix(agent-runtime): preserve MCP tool schema properties - #921
fix(agent-runtime): preserve MCP tool schema properties#921santhiprakash wants to merge 2 commits into
Conversation
Problem: README.md links to evals/README.md, which does not exist. Fix: point the 'our evals' link to evals/buffbench/README.md, the existing evaluation documentation. Verification: confirmed with a local markdown link scan that only the evals/README.md link is broken, and 'ls -l evals/buffbench/README.md' confirms the target exists.
- Problem: MCP tool definitions were being normalized through Zod, which could drop nested JSON Schema details like properties before registration. - Fix: keep the original MCP JSON Schema object on the tool definition and add a regression test that verifies properties.uri survives getToolSet(). - Verification: /home/ubuntu/.bun/bin/bun test packages/agent-runtime/src/__tests__/prompts-schema-handling.test.ts (pass).
|
Verified the targeted regression test for this PR:\n\n- |
|
Nice root-cause analysis and fix. Preserving the original MCP JSON Schema should prevent parameterized tools from losing their input shape. Could we add regression assertions for After resolving the merge conflicts, this looks good to me. |
|
Closing: the source files modified by this PR (packages/agent-runtime/src/tools/prompts.ts) have been removed or reorganized on upstream/main. The patch no longer applies. |
Problem
MCP tools registered through the runtime could lose nested JSON Schema details like
propertiesbefore they reached the model-facing tool definition. That breaks parameterized tools such asmarionette__connectfrom issue #912.Triage / Root cause
packages/agent-runtime/src/tools/prompts.tswas round-tripping additional tool definitions through Zod and then re-emitting a sanitized schema. That conversion path was unnecessary for MCP tools and could discard schema shape that callers already supplied.Fix
properties.urisurvivesgetToolSet().Verification
/home/ubuntu/.bun/bin/bun test packages/agent-runtime/src/__tests__/prompts-schema-handling.test.tsNotes / Risks
upstream/mainwith the required preflight script before editing.sdk/src/tools/run-terminal-command.tsandsdk/src/__tests__/run-terminal-command.test.ts; I left those untouched.Model Used
Checklist